package com.thb.pay.api.agent.fallback;

import com.thb.pay.api.agent.AgentChannelServiceApi;
import com.thb.pay.api.agent.vo.req.AgentChannelReq;
import com.thb.pay.api.agent.vo.resp.AgentChannelVo;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Slf4j
@Component
public class AgentChannelServiceApiFallbackFactory implements FallbackFactory<AgentChannelServiceApi> {


    @Override
    public AgentChannelServiceApi create(Throwable throwable) {
        return new AgentChannelServiceApi() {

            @Override
            public List<AgentChannelVo> findListByAgentId(Long agentId) {
                return null;
            }

            @Override
            public AgentChannelVo getByAgentIdAndProductId(@RequestParam("agentId") Long agentId, @RequestParam("productId") Long productId) {
                return null;
            }

            @Override
            public void addOrUpdate(@RequestBody AgentChannelReq agentChannelReq) {

            }
        };
    }
}